<template>
  <div class="app-container">
    <el-form
      :model="dataForm"
      :rules="dataRule"
      ref="dataForm"
      label-width="120px"
      v-loading="loading"
      class="data-form"
    >
      <el-row>
        <el-col :span="6">
          <el-form-item label="体温" prop="temperature">
            <el-input v-model="dataForm.temperature" placeholder="患者体温[摄氏度]"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="呼吸" prop="breath">
            <el-input v-model="dataForm.breath" placeholder="患者呼吸频率[次/分]"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="血压" prop="bloodPressure">
            <el-input v-model="dataForm.bloodPressure" placeholder="患者血压[mmHg]"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="脉搏" prop="pulse">
            <el-input v-model="dataForm.pulse" placeholder="患者脉搏[次/分]"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item label="侧别" prop="bodySide">
        <el-radio-group v-model="dataForm.bodySide">
          <el-radio
            border
            v-for="dict in dict.type.patient_info_body_side"
            :key="dict.value"
            :label="dict.value"
          >{{dict.label}}</el-radio>
        </el-radio-group>
      </el-form-item>
      <!-- prop="koaGradeId" -->
      <el-form-item label="KOA疾病分级" prop="koaGradeId">
        <el-row>
          <el-col :span="6">
            <el-select style="width: 230px;" v-model="dataForm.koaGradeId" placeholder="请选择KOA等级">
              <el-option
                v-for="(item) in koaGradeList"
                :key="item.id"
                :label="'[' + item.koaGrade + '级 ' + '] ' + 'KOA描述：' + item.koaDescribe"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-col>
          <el-col :span="3">
            <el-dropdown @command="(command) => handleCommand(command)">
              <span class="el-dropdown-link">
                管理KOA等级
                <i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item command="addKoaGrade" icon="el-icon-circle-plus">新增KOA等级</el-dropdown-item>
                <el-dropdown-item command="editKoaGrade" icon="el-icon-s-tools">修改KOA等级</el-dropdown-item>
                <el-dropdown-item command="deleteKoaGrade" icon="el-icon-remove">删除KOA等级</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </el-col>
        </el-row>
      </el-form-item>

      <transition name="el-zoom-in-top">
        <el-form-item label="过敏史" prop="allergyHistory">
          <el-input 
          type="textarea"
          :autosize="{ minRows: 2, maxRows: 4}"
          show-word-limit
          maxlength="300" 
          v-model="dataForm.allergyHistory" placeholder="请输入患者过敏史"></el-input>
        </el-form-item>
      </transition>

      <el-form-item label="是否有既往史" prop="previousDiseaseHistory">
        <el-radio-group @change="previousHistoryChange" v-model="hasPreviousHistory">
          <el-radio border :label="1">是</el-radio>
          <el-radio border :label="0">否</el-radio>
        </el-radio-group>
      </el-form-item>

      <transition name="el-zoom-in-top">
        <div
          class="previous-disease-history"
          v-if="hasPreviousHistory === 1"
          style="margin-bottom:20px;"
        >
          <h3 style="margin-left: 120px; margin-bottom: 30px; color:grey">既往史</h3>
          <el-form-item label="疾病名称" prop="diseaseName">
            <el-input v-model="historyList.previousHistory.diseaseName" placeholder="请输入疾病名称"></el-input>
          </el-form-item>

          <el-form-item label="经历时间" prop="previousHistoryTime">
            <el-date-picker
              style="width:400px;"
              @change="previousHistoryTimeChange"
              v-model="previousHistoryTime"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
            ></el-date-picker>
          </el-form-item>

          <el-form-item label="是否继续">
            <el-switch
              :active-value="1"
              :inactive-value="0"
              v-model="historyList.previousHistory.isContinue"
            ></el-switch>
          </el-form-item>
        </div>
      </transition>

      <el-form-item label="是否首次治疗" prop="isFirstTreatment">
        <el-radio-group @change="firstTreatmentChange" v-model="dataForm.isFirstTreatment">
          <el-radio border :label="1">是</el-radio>
          <el-radio border :label="0">否</el-radio>
        </el-radio-group>
      </el-form-item>

      <transition name="el-zoom-in-top">
        <el-form-item label="KOA治疗历史" v-if="dataForm.isFirstTreatment == 0" prop="treatmentType">
          <el-checkbox-group v-model="treatmentType" @change="treatmentTypeChange">
            <el-checkbox-button
              v-for="(item, index) in treatmentTypeList"
              :label="item"
              :key="index"
            >{{item}}</el-checkbox-button>
          </el-checkbox-group>
        </el-form-item>
      </transition>

      <transition name="el-zoom-in-top">
        <div v-if="hasKoaDrugHistory">
          <h3 style="margin-left: 120px; margin-bottom: 30px; color:grey">KOA治疗史（药物治疗）</h3>
          <drug-history :hasContinue="true" ref="koaDrug"></drug-history>
        </div>
      </transition>

      <transition name="el-zoom-in-top">
        <div v-if="hasKoaNonDrugHistory">
          <h3 style="margin-left: 120px; margin-bottom: 30px; color:grey">KOA治疗史（非药物治疗）</h3>
          <non-drug-history :hasContinue="true" ref="koaNonDrug"></non-drug-history>
        </div>
      </transition>

      <transition name="el-zoom-in-top">
        <div v-if="hasKoaOperationHistory">
          <h3 style="margin-left: 120px; margin-bottom: 30px; color:grey">KOA治疗史（手术治疗）</h3>
          <operation-history ref="koaOperation"></operation-history>
        </div>
      </transition>
    </el-form>

    <div style="text-align:center">
      <el-button type="primary" @click="prev" v-if="!isDisease">上一步</el-button>
      <el-button type="primary" :loading="buttonLoading" @click="saveOrAddInfoData">保存并下一步</el-button>
    </div>

    <!-- 添加或修改KOA等级对话框 -->
    <el-dialog
      title="添加KOA等级"
      :visible.sync="addKoaVisible"
      width="30%"
      :before-close="addKoaClose"
    >
      <el-form :model="koaForm">
        <el-form-item label="KOA等级" label-width="120">
          <el-input-number v-model="koaForm.koaGrade" :min="0" :max="10"></el-input-number>
        </el-form-item>
        <el-form-item label="KOA描述" label-width="120">
          <el-input
            v-model="koaForm.koaDescribe"
            type="textarea"
            autocomplete="off"
            :placeholder="koaExample"
          ></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="addKoaClose">取 消</el-button>
        <el-button type="primary" @click="submitAddKoa">添 加</el-button>
      </span>
    </el-dialog>

    <!-- KOA列表 -->
    <!-- 疾病信息列表对话框 -->
    <el-dialog
      title="选择疾病信息"
      :visible.sync="listKoaVisible"
      width="30%"
      :v-loading="listKoaLoading"
      :before-close="listKoaClose"
    >
      <el-table :data="koaDialogList">
        <el-table-column align="center" width="100px" property="koaGrade" label="KOA等级">
          <template slot-scope="scope">
            <el-tag>{{ scope.row.koaGrade }}级</el-tag>
          </template>
        </el-table-column>
        <el-table-column align="center" width="200px" property="koaDescribe" label="KOA描述" :show-overflow-tooltip="true"></el-table-column>
        <el-table-column align="center" width="100px" label="操作">
          <template slot-scope="scope">
            <el-button
              type="text"
              size="mini"
              icon="el-icon-delete"
              @click="removeKoaGrade(scope.row)"
              v-if="koaDelete"
            >删除</el-button>
            <el-popover
            v-else
            placement="bottom"
            title="修改KOA等级"
            width="400"
            trigger="click">
            <div> 
            <el-form :model="koaForm">
                <el-form-item label="KOA等级" label-width="120" property="koaGrade">
                  <el-input-number v-model="koaForm.koaGrade" :min="0" :max="10"></el-input-number>
                </el-form-item>
                <el-form-item label="KOA描述" label-width="120" property="koaDescribe">
                  <el-input
                    v-model="koaForm.koaDescribe"
                    type="textarea"
                    autocomplete="off"
                    :placeholder="koaExample"
                  ></el-input>
                </el-form-item>
              </el-form>
              <span slot="footer" class="dialog-footer" style="margin-left: 300px;">
                <el-button type="primary" @click="submitAddKoa">修 改</el-button>
              </span>
            </div>
            <el-button
              type="text"
              size="mini"
              icon="el-icon-edit"
              slot="reference"
              @click="openEditKoaGrade(scope.row)"
            >修改</el-button>
          </el-popover>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script>
import DrugHistory from "../history/drug-history";
import NonDrugHistory from "../history/non-drug-history";
import OperationHistory from "../history/operation-history";
import { koaGrads } from "@/api/gonitis/basicInfo";
import { saveDiseaseInfo, updateDiseaseInfo, queryDiseaseInfo } from "@/api/gonitis/diseaseInfo";
import { koaGradeSave, koaGradeInfo, koaGradeUpdate, koaGradeRemove } from "@/api/gonitis/koaGrade";
export default {
  name: "DiseaseInfo",
  dicts: ["patient_info_body_side"],
  //import 引入的组件需要注入到对象中才能使用
  components: {
    DrugHistory,
    NonDrugHistory,
    OperationHistory
  },
  data() {
    //这里存放数据
    return {  
      // 表单遮罩层
      loading: false,
      buttonLoading: false,
      // 对话框Loading
      listKoaLoading: false,
      // 删除KOA信息
      koaDelete: false,
      // 修改或删除koa集合
      koaDialogList: [],
      // koa集合对话框
      listKoaVisible: false,
      isDisease: false,
      koaExample:
        "请输入KOA描述如: 正常, 关节间隙正常, 没有骨赘, 没有明显的畸形",
      koaForm: {
        koaGrade: null,
        koaDescribe: null
      },
      addKoaVisible: false,
      treatmentTypeList: ["药物治疗", "非药物治疗", "手术治疗"],
      treatmentType: [],
      previousHistoryTime: [],
      hasPreviousHistory: 0,
      hasKoaDrugHistory: false,
      hasKoaNonDrugHistory: false,
      hasKoaOperationHistory: false,
      koaGradeList: [],
      diseaseInfoData: {},
      historyList: {
        previousHistory: {
          id: null,
          diseaseName: "",
          startTime: "",
          endTime: "",
          isContinue: null
        },
        koaDrugHistory: {
          drugName: "",
          drugType: "",
          drugUsage: "",
          endTime: "",
          isContinue: null,
          startTime: ""
        },
        koaNonDrugHistory: {
          endTime: "",
          isContinue: 0,
          startTime: "",
          treatmentFrequency: "",
          treatmentUsage: ""
        },
        koaOperationHistory: {
          operationName: "",
          treatmentUnit: "",
          startTime: null,
          endTime: null
        }
      },
      dataForm: {
        id: undefined,
        basicInfoId: null,
        temperature: null,
        breath: null,
        bodySide: null,
        temperature: null,
        bloodPressure: null,
        pulse: null,
        bodySide: null,
        koaGradeId: null,
        allergyHistory: "",
        previousHistoryId: "",
        isFirstTreatment: 1,
        koaDrugHistoryId: null,
        koaNonDrugHistoryId: null,
        koaOperationHistoryId: null
      },
      dataRule: {
        koaGradeId: [
          {
            required: true,
            message: "KOA等级必须选择",
            trigger: ["blur", "change"]
          }
        ],
        temperature: [
          {
            validator: (rule, value, callback) => {
              if (!value) {
                callback(new Error("患者体温必须填写"));
              } else if (!/^[0-9]+.?[0-9]*/.test(value)) {
                callback(new Error("体温必须为数字值"));
              } else {
                callback();
              }
            },
            required: true,
            trigger: "blur"
          }
        ],
        breath: [
          {
            validator: (rule, value, callback) => {
              if (!value) {
                callback(new Error("患者呼吸频率必须填写"));
              } else if (!/^[0-9]+.?[0-9]*/.test(value)) {
                callback(new Error("患者呼吸频率必须为数字值"));
              } else {
                callback();
              }
            },
            required: true,
            trigger: "blur"
          }
        ],
        bloodPressure: [
          {
            validator: (rule, value, callback) => {
              if (!value) {
                callback(new Error("患者血压必须填写"));
              } else if (!/^[0-9]+.?[0-9]*/.test(value)) {
                callback(new Error("患者血压必须为数字值"));
              } else {
                callback();
              }
            },
            required: true,
            trigger: "blur"
          }
        ],
        pulse: [
          {
            validator: (rule, value, callback) => {
              if (!value) {
                callback(new Error("患者脉搏必须填写"));
              } else if (!/^[0-9]+.?[0-9]*/.test(value)) {
                callback(new Error("患者脉搏必须为数字值"));
              } else {
                callback();
              }
            },
            required: true,
            trigger: "blur"
          }
        ],
        bodySide: [
          {
            required: true,
            message: "患者侧别必须选择",
            trigger: ["change"]
          }
        ],
        koaGradeId: [
          {
            required: true,
            message: "KOA疾病分级必须选择",
            trigger: ["blur", "change"]
          }
        ],
        treatmentType: [
          {
            validator: (rule, value, callback) => {
              if (
                !this.treatmentType ||
                this.treatmentType.length === 0
              ) {
                callback(new Error("KOA治疗史必须选择"));
              } else {
                callback();
              }
            },
            required: true,
            trigger: ["blur", "change"]
          }
        ],
        diseaseName: [
          {
            validator: (rule, value, callback) => {
              if (
                !this.historyList.previousHistory.diseaseName
              ) {
                callback(new Error("疾病名称必须填写"));
              } else {
                callback();
              }
            },
            required: true,
            trigger: "blur"
          }
        ],
        previousHistoryTime: [
          {
            validator: (rule, value, callback) => {
              if (
                !this.historyList.previousHistory.startTime ||
                !this.historyList.previousHistory.endTime
                ) {
                callback(new Error("药物使用时间必须选择"));
              } else {
                callback();
              }
            },
            required: true,
            trigger: ["blur", "change"]
          }
        ]
      }
    };
  },
  //方法集合
  methods: {
    /** 处理编辑koaGrade的三个事件 */
    handleCommand(command) {
      switch (command) {
        case "addKoaGrade":
          this.openKoaGrade(0);
          break;
        case "editKoaGrade":
          this.openKoaGrade(1);
          break;
        case "deleteKoaGrade":
          this.openKoaGrade(2);
          break;
        default:
          break;
      }
    },
    /** 打开koa对话框 */
    openKoaGrade(value){
      const sysDeptId = this.$parent.deptId;
      if(value === 0){
        // 添加KAO
        this.addKoaVisible = true;
      }else if(value === 1){
        // 打开KOA列表
        this.listKoaVisible = true;
        this.listKoaLoading = true;
        koaGrads(sysDeptId).then(response => {
          this.koaDialogList = response.data;
          this.koaDelete = false;
          this.listKoaLoading = false;
        }); 
      }else{
        this.listKoaVisible = true;
        this.listKoaLoading = true;
        koaGrads(sysDeptId).then(response => {
          this.koaDialogList = response.data;
          this.koaDelete = true;
          this.listKoaLoading = false;
        });
      }
    },
    /** 删除KOA信息 */
    removeKoaGrade(row){
      const id = row.id;
      this.$modal.confirm('是否确认删除【KOA等级信息】编号为"' + id + '"的数据项？').then(() => {
        return koaGradeRemove(id);
      }).then(() => {
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      }).finally(() => {
        this.listKoaClose();
      });
    },
    openEditKoaGrade(row){
      koaGradeInfo(row.id).then(response => {
        this.koaForm = response.data;
        this.koaForm.subId = null;
      });
    },
    /** KOA编辑列表对话框关闭 */
    listKoaClose(){
      this.koaDialogList = [];
      this.listKoaVisible = false;
    },
    /** 提交KOAGRADE */
    submitAddKoa() {
      const koaGrade = this.koaForm;
      if(koaGrade.id){
        // 修改
        koaGradeUpdate(koaGrade).then(response => {
          this.$modal.msgSuccess("修改成功");
          this.getKoaGrade();
          this.listKoaClose();
        });
      }else{
        // 保存
          koaGradeSave(koaGrade).then(response => {
          this.$modal.msgSuccess("保存成功");
          this.getKoaGrade();
          this.addKoaClose();
        });
      }
    },
    /** 关闭新增KOAgrade对话框 */
    addKoaClose() {
      this.koaForm.koaGrade = null;
      this.koaForm.koaDescribe = null;
      this.addKoaVisible = false;
    },
    /** 上一步 */
    prev() {
      this.$parent.active = 0;
    },
    /** 保存信息并下一步 */
    saveOrAddInfoData() {
      // 先确保当前页面的数组校验
      const flag = this.getAllHistory();
      if (flag === false) {
        // 如果校验失败就直接返回不执行下一步
        return;
      }
      // 然后校验组件内容
      this.$refs["dataForm"].validate(valid => {
        if (valid) {
          // 进行保存操作
          this.buttonLoading = true;
          this.dataForm.treatmentMap = this.historyList;
          if (this.dataForm.id) {
            // 修改操作
            updateDiseaseInfo(this.dataForm).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.$emit("parent-event");
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            // 添加操作
            saveDiseaseInfo(this.dataForm).then(response => {
              this.$modal.msgSuccess("保存成功");
              this.dataForm.id = response.data;
              this.$parent.diseaseInfoId = response.data;
              this.$emit("parent-event");
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 获取所有历史数据 */
    getAllHistory() {
      if (this.hasKoaDrugHistory) {
        // 子组件加载完全后再获取值
        const koaDrugHistory = this.$refs.koaDrug.submit("koaDrugHistory");
        // 判断通过的话就将koaDrugHistory直接放入到集合中
        if (koaDrugHistory === null) {
          // 如果子组件校验失败就直接返回false
          return false;
        } else {
          // 添加子组件的drugHistory
          this.historyList.koaDrugHistory = koaDrugHistory;
        }
      }
      if (this.hasKoaNonDrugHistory) {
        const koaNonDrugHistory = this.$refs.koaNonDrug.submit(
          "koaNonDrugHistory"
        );
        // 判断通过的话就将koaNonDrugHistory直接放入到集合中
        if (koaNonDrugHistory === null) {
          // 如果子组件校验失败就直接返回false
          return false;
        } else {
          // 添加子组件的drugHistory
          this.historyList.koaNonDrugHistory = koaNonDrugHistory;
        }
      }
      if (this.hasKoaOperationHistory) {
        const koaOperationHistory = this.$refs.koaOperation.submit(
          "koaOperationHistory"
        );
        // 判断通过的话就将koaNonDrugHistory直接放入到集合中
        if (koaOperationHistory === null) {
          // 如果子组件校验失败就直接返回false
          return false;
        } else {
          // 添加子组件的drugHistory
          this.historyList.koaOperationHistory = koaOperationHistory;
        }
      }
    },
    /** 治疗方式选择 */
    treatmentTypeChange(value) {
      this.hasKoaDrugHistory = false;
      this.hasKoaNonDrugHistory = false;
      this.hasKoaOperationHistory = false;
      for (let i = 0; i < value.length; i++) {
        if (value[i] === this.treatmentTypeList[0]) {
          this.hasKoaDrugHistory = true;
        }
        if (value[i] === this.treatmentTypeList[1]) {
          this.hasKoaNonDrugHistory = true;
        }
        if (value[i] === this.treatmentTypeList[2]) {
          this.hasKoaOperationHistory = true;
        }
      }
    },
    /** 既往史时间改变 */
    previousHistoryTimeChange(value) {
      if (value !== null && value.length === 2) {
        this.historyList.previousHistory.startTime = value[0];
        this.historyList.previousHistory.endTime = value[1];
      } else if (value === null) {
        this.historyList.previousHistory.startTime = null;
        this.historyList.previousHistory.endTime = null;
      }
    },
    /** 既往史改变 */
    previousHistoryChange(value) {
      if (value === 0) {
        this.previousHistoryTime = null;
        this.historyList.previousHistory = {};
      }
    },
    /** 首次治疗改变 */
    firstTreatmentChange(value) {
      if (value === 1) {
        this.treatmentType = [];
        this.hasKoaDrugHistory = false;
        this.hasKoaNonDrugHistory = false;
        this.hasKoaOperationHistory = false;
      }
    },
    /** 获取KOA等级 */
    getKoaGrade() {
      const sysDeptId = this.$parent.deptId;
      koaGrads(sysDeptId).then(response => {
        this.koaGradeList = response.data;
      });
    },
    /** 设置basicId */
    setBasicId() {
      this.dataForm.basicInfoId = this.$parent.basicInfoId;
      this.getKoaGrade();
      if(this.$parent.updateFlag === 3){
        this.isDisease = true;
      }
    },
    /** 初始化数据 */
    init() {
      this.getKoaGrade();
      this.fetchData();
    },
    /** 修改时初始化数据 */
    fetchData() {
      const diseaseId = this.dataForm.id;
      this.loading = true;
      queryDiseaseInfo(diseaseId).then(response => {
        const diseaseInfo = response.data;
        this.dataForm.basicInfoId = diseaseInfo.basicInfoId
        this.dataForm.temperature = diseaseInfo.temperature;
        this.dataForm.breath = diseaseInfo.breath;
        this.dataForm.pulse = diseaseInfo.pulse;
        this.dataForm.bloodPressure = diseaseInfo.bloodPressure;
        this.dataForm.bodySide = diseaseInfo.bodySide;
        this.dataForm.koaGradeId = diseaseInfo.koaGradeId;
        this.dataForm.allergyHistory = diseaseInfo.allergyHistory;
        if (diseaseInfo.previousHistoryId) {
          this.hasPreviousHistory = 1;
          this.historyList.previousHistory =
            diseaseInfo.treatmentMap.previousHistory;
          this.historyList.previousHistory.id = null;
          this.previousHistoryTime.push(
            diseaseInfo.treatmentMap.previousHistory.startTime
          );
          this.previousHistoryTime.push(
            diseaseInfo.treatmentMap.previousHistory.endTime
          );
        }
        this.dataForm.isFirstTreatment = diseaseInfo.isFirstTreatment;
        if (diseaseInfo.koaDrugHistoryId) {
          this.treatmentType.push(this.treatmentTypeList[0]);
          this.hasKoaDrugHistory = true;
          this.historyList.koaDrugHistory =
            diseaseInfo.treatmentMap.koaDrugHistory;
          this.historyList.koaDrugHistory.id = null;
          this.$nextTick(() => {
            const history = this.historyList.koaDrugHistory;
            this.$refs.koaDrug.putDrugHistory(history);
          });
        }
        if (diseaseInfo.koaNonDrugHistoryId) {
          this.treatmentType.push(this.treatmentTypeList[1]);
          this.hasKoaNonDrugHistory = true;
          this.historyList.koaNonDrugHistory =
            diseaseInfo.treatmentMap.koaNonDrugHistory;
          this.historyList.koaNonDrugHistory.id = null;
          this.$nextTick(() => {
            const history = this.historyList.koaNonDrugHistory;
            this.$refs.koaNonDrug.putNonDrugHistory(history);
          });
        }
        if (diseaseInfo.koaOperationHistoryId) {
          this.treatmentType.push(this.treatmentTypeList[2]);
          this.hasKoaOperationHistory = true;
          this.historyList.koaOperationHistory =
            diseaseInfo.treatmentMap.koaOperationHistory;
          this.historyList.koaOperationHistory.id = null;
          this.$nextTick(() => {
            const history = this.historyList.koaOperationHistory;
            this.$refs.koaOperation.putOperationHistory(history);
          });
        }
        this.loading = false;
      });
    }
  },
  //生命周期 - 挂载完成（可以访问 DOM 元素）
  mounted() {
    this.dataForm.basicInfoId = this.$parent.basicInfoId;
    if (this.$parent.diseaseInfoId) {
      // 直接获取详情
      this.dataForm.id = this.$parent.diseaseInfoId;
      this.isDisease = true;
      this.init();
    }
  }
};
</script>

<style scoped>
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
</style>